The 'Expression area'
In the 'Expression area' you can type the property calculation expression manually, or use elements from the 'Functions and variables area'. For an overview of the different areas on the form, see The Property Calculator.
In the upper-right corner of the 'Expression area' the following tools are available:
Automatically add checks for undefined values.
Undefined values may be frequently encountered when working with JewelSuite Geomechanics, but taking account of them in Property Calculator expressions may require some special care and understanding to avoid receiving unexpected and seemingly 'incorrect' results.
Take, for example, the expression
if $Porosity$ > 0.20 then "Sand" else if $Porosity$ < 0.15 then "Clay" else "Silt"
If the porosity is undefined, the two comparisons will evaluate to False, and the end result of the expression will be Silt. So the rock type will always be silt whenever the porosity is not known, which is probably not what would typically be intended.
This means that the possibility of the value being undefined, or null, should be explicitly considered in the expression, as in
if $Porosity$ = null then null else if $Porosity$ > 0.20 then "Sand" else if $Porosity$ < 0.15 then "Clay" else "Silt"
This will now yield the intended answer.
Clicking the
button will automatically insert such checks for you.
Generate discrete expression
You can generate discrete expressions based on discrete classes of your selected object. To do this:
- Click on the Generate discrete expression icon.
- Under Property, select a discrete property.
- Select either 'Names' or 'Values'. If you want the expression to relate to the names of properties, select the Names option. If the expression should relate to values of properties, select Values. See below for further explanations.
- Click Apply or OK to include the generated expression in the Expression area of the Property Calculator.
Examples of discrete expressions:
|
$Porosity$ * 2.0 |
Creates a property which has twice the porosity property values |
|
if( $Lithology$ = #Lithology|Shale# ) then 0.05 else if( $Lithology$ = #Lithology|Sandstone# ) then 0.15 else if( $Lithology$ = #Lithology|Sand# ) then 0.23 null |
Creates a property with a 0.05 value for each Shale cell, 0.15 for each Sandstone cell, etc. |
|
$Porosity$ * $Cell Volume$ |
Creates a property with the Pore Volume |
|
$Property$[timeIndex + 1] - $Property$[timeIndex] |
Time derivative |
Select previous expression
The Select previous expression form shows a list of all the expressions that you applied after the solution was last saved. This way you can easily re-apply expressions without the need of saving them to a template. Note that the list will be emptied when you close the solution. 'Old' expressions that were used to generate a property can be recalled via 'view history'.
To use an expression: double-click on an expression in the list, or select an expression and click Apply or OK; the expression is added to (the end of) the Expression field.
With the Save expression form you can save expressions in the Property Calculator as templates for future use.
- Click on the Save expression icon to save your expression. The Save Expression form will open with the expression displayed in the Expression field.
- Enter a name for the template in the Name field. (Select the name of an existing template to overwrite this template.)
- You have two options to save the expression. Select Application to save the expression at application level, which means the expression is available in other solutions. Selecting This solution means the expression is only available in the solution you are currently working in.
- Make any changes you wish to make to the expression, and click Apply or OK to save it.
To use your template, you can load it into the Property Calculator by clicking the Load from template button. See 'Load expression' below.
Load expression
You can recall saved expressions (to save an expression, see 'Save expression' above) and select different properties to incorporate into this expression to create a new expression.
- Click on the Load expression icon to open the Load Expression Template form.
- Choose the template you want to load from the Name drop-down list. (If you want to remove an existing template, select it in the list and click the Remove button.)
- You can now swap properties in your expression by selecting a different property in the drop-down list at the bottom of the form (under Properties). Select a different property. The original expression will remain shown on the left (under Expression), with a preview of the 'new' expression showing on the right (under Preview).
- Check the expression in the Preview window and click Apply or OK.